package com.itany.corejava.day06;

public class Person {
    //特征 属性
    private String name;
    private int age;
    private boolean sex;
    private double money;
    private String 手;
    private String 眼睛;
    private String 心脏;

    //行为 方法
    //构造方法
    public Person(boolean sex){
        //我
        System.out.println("this = " + this);
        this.sex=sex;
        age=1;
//        money=0.0;
    }

    public Person(String name,boolean sex){
        //我 表示当前对象，谁调用这个方法，谁是this
        System.out.println("this = " + this);
        this.name=name;
        this.sex=sex;
        age=1;
//        money=0.0;
    }

//    public Person(boolean s){
//        sex=s;
//        age=1;
////        money=0.0;
//    }
//
//    public Person(String n,boolean s){
//        name=n;
//        sex=s;
//        age=1;
////        money=0.0;
//    }


    public Person(String name, int age, boolean sex) {
        this.name = name;
        setAge(age);
        this.sex = sex;
    }


    public Person() {
    }

    //方法
    public void eat(String food){
        System.out.println(name+"正在吃"+food);
    }

    public void sleep(){
        System.out.println(name+"正在睡觉");
    }



    public String getName(){
        return this.name;
    }

    public void setAge(int age){
        if(age<1||age>120){
            System.out.println("年龄不符合现实逻辑");
            return;
        }
        this.age=age;
    }

    public int getAge(){
        return this.age;
    }

    public String getSex(){
        return true==sex?"男":"女";
    }

    public void setSex(String sex){
        this.sex="男".equals(sex)?true:false;
    }


    public void setName(String name) {
        this.name = name;
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String get手() {
        return 手;
    }

    public void set手(String 手) {
        this.手 = 手;
    }

    public String get眼睛() {
        return 眼睛;
    }

    public void set眼睛(String 眼睛) {
        this.眼睛 = 眼睛;
    }

    public String get心脏() {
        return 心脏;
    }

    public void set心脏(String 心脏) {
        this.心脏 = 心脏;
    }
}
